<template>
  <div>
    <div class="banner" :style="{width:fullWidth + '%',height:fullHeight+'px'}">
      <div class="banner_img_box" :style="{width:fullWidth + '%'}"></div>
    </div>
    <div class="card_module">
      <ul><li v-for="(item) in cardList" :key="item.code"></li></ul>
    </div>

    <div class="home_info">
      <div class="img_module">
        <div class="img_box"></div>
      </div>
      <div class="info_module">
        <div class="info_head">
          <div class="head_text">软硬兼备自由组合</div>
          <div class="head_text">满足多种经营需要</div>
        </div>
        <p>23232</p>
        <el-button type="primary" class="info_btn">{{$t('homePage_consult_now_btn')}}</el-button>
      </div>
    </div>

  </div>
</template>

<script>
export default {
  data() {
    return {
      fullWidth: 100,
      fullHeight: document.documentElement.clientHeight * 0.3,
      cardList: [
        {code:'1'},
        {code:'2'},
        {code:'3'},
        {code:'4'},
        {code:'5'},
        ]
    }
  },
  created() {
    window.addEventListener('resize',this.handleResize)
  },
  beforeUnmount() {
    window.removeEventListener('resize',this.handleResize)
  },
  methods: {
    handleResize() {
      this.fullWidth = 100
      this.fullHeight = document.documentElement.clientHeight * 0.3
    }
  }
}
</script>

<style scoped>
  .banner {
    position: relative;
    z-index: -1;
  }
  .banner_img_box {
    position: absolute;
    background-image: url('../../static/banner.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    height: 100%;
  }
  .card_module>ul {
    display: flex;
    justify-content: space-between;
    padding: 0;
  }
  .card_module>ul>li {
    flex: 1;
    height: 100px;
    line-height: 100;
    background: rgba(121, 121, 121, 1);
  }
  .card_module>ul>li:not(:last-child) {
    margin-right: 20px;
  }
  .home_info {
    border: 1px solid rgba(121, 121, 121, 1);
    height: 300px;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
  }
  .img_module {
   flex: 1;
    height: 100%;
    background: red;
  }
  .img_box {
    background-image: url('../../static/homeInfo.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    height: 100%;
  }
  .info_module {
    margin-left: 40px;
    flex: 2.5;
    height: 100%;
    position: relative;
  }
  .info_head {
    margin-top: 30px;
  }
  .head_text {
    color: black;
    font-size: 18px;
    font-weight: bold;
  }
  .info_btn_box {
    position: relative;
    width: 100%;
  }
  .info_btn {
    position: absolute;
    bottom: 30px;
    right: 50px;
  }
</style>